#ifndef __WDTXLCD5110_H_
#define __WDTXLCD5110_H_

#include "sys.h"

//#define _LCD5110_LARGE_FONT_

//数据接口定义
#define LCD5110_CLK   PBout(9)     //串行时钟			//上升沿写入数据
#define LCD5110_DIN   PBout(8)     //串行数据输入		//先高后低
#define LCD5110_DC    PBout(7)     //数据指令控制端	//高电平数据，低电平指令
#define LCD5110_CS    PBout(6)     //片选使能			//低电平有效
#define LCD5110_RST   PBout(5)     //LCD复位端		//低电平复位

//指令宏定义
#define LCD5110_X_Col_Addr     0x80		//定位到第0列指令(列起始地址)(0 - 83)
#define LCD5110_Y_Page_Addr    0x40		//定位到第0页指令(页起始地址)(0 - 5)

//便于理解
#define LCD5110_write_cmd(cmd)	LCD5110_write_byte(cmd, 0)	//写入指令
#define LCD5110_write_dat(dat)	LCD5110_write_byte(dat, 1)	//写入数据

//液晶显示控制(不影响DDRAM)
#define LCD5110_show_blank		LCD5110_write_cmd(0x08)		//显示空白
#define LCD5110_show_normal		LCD5110_write_cmd(0x0c)		//正常显示
#define LCD5110_show_black		LCD5110_write_cmd(0x09)		//显示全黑
#define LCD5110_show_inverse 	LCD5110_write_cmd(0x0d)		//反色显示

#define LCD5110_reset_hard	LCD5110_RST = 0; LCD5110_RST = 1	//硬件复位
#define LCD5110_reset_soft	LCD5110_reset_5510()			//软件复位

void LCD5510_Init(void);
void LCD5110_printsl(unsigned char x, unsigned char y, char*s_dat);
void LCD5110_prints(unsigned char x, unsigned char y, char *s_dat);
void LCD5110_printc(unsigned char x, unsigned char y, char c_dat);
void LCD5110_clr_row(unsigned char num);
void LCD5110_pos_byte(unsigned char x, unsigned char y);
void LCD5110_clr_scr(void);
void LCD5110_write_byte(unsigned char wbyte, unsigned char dat_cmd);

#endif
